﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="AdministratorGroup" table="cmsAdministratorGroup">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Name" type="System.String">
      <column name="Name" not-null="true" />
    </property>
    <property name="DefaultPageAccess" type="NHibernate.Type.EnumStringType`1[[Cms.Domain.DefaultAccess, Cms.Domain]], NHibernate">
      <column name="DefaultPageAccess" not-null="true" />
    </property>
    <property name="DefaultCustomAdminPageAccess" type="NHibernate.Type.EnumStringType`1[[Cms.Domain.DefaultAccess, Cms.Domain]], NHibernate">
      <column name="DefaultCustomAdminPageAccess" not-null="true" />
    </property>
    <bag cascade="save-update" name="Administrators" table="cmsAdministrator" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <one-to-many class="Administrator" />
    </bag>
    <bag inverse="true" name="AllowedPages" table="cmsAdministratorGroupAllowedPage" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Page">
        <column name="PageID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedPages" table="cmsAdministratorGroupDeniedPage" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Page">
        <column name="PageID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="AllowedFolders" table="cmsAdministratorGroupAllowedFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Folder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedFolders" table="cmsAdministratorGroupDeniedFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Folder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="AllowedMediaFolders" table="cmsAdministratorGroupAllowedMediaFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFolder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedMediaFolders" table="cmsAdministratorGroupDeniedMediaFolder" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFolder">
        <column name="FolderID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="AllowedMediaFiles" table="cmsAdministratorGroupAllowedMediaFile" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFile">
        <column name="FileID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedMediaFiles" table="cmsAdministratorGroupDeniedMediaFile" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="MediaFile">
        <column name="FileID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="AllowedContent" table="cmsAdministratorGroupAllowedContent" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Content">
        <column name="ContentID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedContent" table="cmsAdministratorGroupDeniedContent" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Content">
        <column name="ContentID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="AllowedCustomAdminPages" table="cmsAdministratorGroupAllowedCustomAdminPage" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="CustomAdminPage">
        <column name="CustomAdminPageID" />
      </many-to-many>
    </bag>
    <bag inverse="true" name="DeniedCustomAdminPages" table="cmsAdministratorGroupDeniedCustomAdminPage" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="CustomAdminPage">
        <column name="CustomAdminPageID" />
      </many-to-many>
    </bag>
    <bag name="Permissions" inverse="true" table="cmsAdministratorGroupPermission" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="GroupID" />
      </key>
      <many-to-many class="Permission">
        <column name="PermissionID" />
      </many-to-many>
    </bag>
  </class>
</hibernate-mapping>